package JunitTest;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.util.Collection;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

@RunWith(Parameterized.class)
public class FetchMoneyTest {
	boolean expected;
	int money;
	FetchMoney fcm;
	
	public FetchMoneyTest(boolean expected, int money) {
		this.expected = expected;
		this.money = money;
	}
	
	@Parameters
	public static Collection<Object[]> ourMoney(){
		return Arrays.asList(new Object[][] {
			{true, 51},
			{true, 93},
			{false, 94},
			{false, -1},
			{true, 0},
			{true, 35},
			{false,39}
		});
	}
	
	@Before
	public void setUp() {
		fcm = new FetchMoney();
	}
	
	@Test
	public void testFetch() {
		assertEquals(this.expected, fcm.fetch(this.money));
	}
}
